<script>
import { defineComponent } from 'vue';
import h from 'lowCodeUtils/render.js'
export default defineComponent({
  name: 'CustomMakeRender',
    props: {
        render:{
            type:String,
            default:""
        },
        componentName:{
            type:String,
            default:"el-button"
        },
        isUseRender:{
            type:Boolean,
            default:false
        },
        props:{
            type:Object,
            default:() => {
                return {id:"sddd"}
            }
        }
    },
    setup(props) {
        let render = () => {
            if (props.isUseRender) {
                let renderFun = null
                eval('renderFun = ' + props.render)
                console.log(renderFun)
                if (renderFun) {
                    return renderFun(h,props.props)
                } else {
                    return ""
                }
            } else {
                console.log(props.props)
                return h('div',[
                    h(props.componentName,JSON.parse(props.props),'aaa')
                ]) 
            }
        }
        return render
    },
    created(){

    },
    mounted(){

    },
    methods() {
        
    }
    
})

</script>
